<?php

namespace services\models;

use Yii;

/**
 * This is the model class for table "d_try.money_table".
 *
 * @property integer $uid
 * @property integer $member_uid
 * @property integer $order_info_id
 * @property integer $order_id
 * @property double $money
 * @property double $start_money
 * @property double $end_money
 * @property string $memo
 * @property integer $type
 * @property integer $modify_uid
 * @property string $modify_ip
 * @property integer $addtime
 */
class MoneyTable extends \common\models\MoneyTable
{
    public static $TYPE_DESC = [1=>'购物消费', 2=>'后台操作', 3=>'取消订单'];
    public static $_TYPE_USER_ORDER = 1;
    public static $_TYPE_ADMIN_ORDER = 2;
    public static $_TYPE_CANCEL = 3;
    public $order_info_id;


    public function beforeSave($insert)
    {
        if($insert){
            $this->addtime = time();
            $this->modify_ip = '';
            $this->modify_uid = 0;
            $this->order_id = $this->order_info_id;

        }
        return parent::beforeSave($insert);
    }

}
